<template>
  <b-row v-if="data.id != 'crid1'" @click="toDetail">
    <!-- 封面图 -->
    <b-col class="col-auto">
      <b-img class="rounded-lg border" height="150px" width="100px"
        :src="fanju == null?'https://s1.imagehub.cc/images/2023/03/27/c6c15085392b10160e0141e725c0ce91.webp':'https://images.weserv.nl/?url='+fanju.cover" />
    </b-col>
    <!-- 标题和内容 -->
    <b-col>
      <b-row>
        <h5>
          <b-link @click="toDetail" class="text-decoration-none text-dark">
            {{fanju != null?fanju.title:'正在获取标题...'}}
          </b-link>
        </h5>
      </b-row>
      <!-- 打分 -->
      <b-row>
        <span style="font-size:20px;color:orange;" class="iconfont icon-favorite-filling">{{data.score}}</span>
      </b-row>
      <b-row class="mt-2 pr-4">
        <span class="content overflow-hidden">
          {{data.content}}
        </span>
      </b-row>
    </b-col>
  </b-row>
</template>
<script>
export default {
  props: {
    data: Object
  },
  data() {
    return {
      fanju: null
    }
  },
  created() {
    if (this.data.bangumiId != "1") {
      this.$httpBangumi.bangumiSimple(this.data.bangumiId).then((res) => {
        this.fanju = res
        console.log(res);
      }).catch((err) => {
        console.log(err);
      });
    }
  },
  methods: {
    //进入详情
    toDetail() {
      this.$pageRedirect.toAnimationDetails(this.data.bangumiId, "media_id");
    }
  },
}
</script>
<style scoped>
</style>
